package com.usooft.metaTalent.db.platform;

import com.usooft.framework.core.query.Page;
import com.usooft.framework.web.auth.RequiresPermission;
import com.usooft.metaTalent.core.platform.service.ArticleTagService;
import com.usooft.metaTalent.core.platform.wrapper.ArticleTagWrapper;
import com.usooft.metaTalent.db.platform.form.ArticleTagListForm;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/platform/article-tag")
@RequiredArgsConstructor
public class ArticleTagController {
    private final ArticleTagService articleTagService;

    @GetMapping("/list")
    @RequiresPermission(
            value = "/platform/article-tag/list",
            description = "文章标签/查询"
    )
    public ResponseEntity<?> list(ArticleTagListForm form) {
        Page<ArticleTagWrapper> page = articleTagService.page(form.buildQuery());
        return ResponseEntity.ok(page);
    }
}
